#region Copyright Notice
// 
// 
//  
//  Copyright (c) 2009-2011 Anindya Chatterjee
//  
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//  
//      http://www.apache.org/licenses/LICENSE-2.0
//  
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
// 
// 
#endregion
using System;

namespace AbstractClass.NPerf.Framework
{
    /// <summary>
    /// Instructs the NPerf test runner to call the method for calculating performance counter.
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public sealed class PerfTestCounterAttribute : Attribute
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PerfTestCounterAttribute"/> class.
        /// </summary>
        /// <param name="categoryName">Name of the category.</param>
        /// <param name="counterName">Name of the counter.</param>
        /// <param name="instanceName">Name of the instance.</param>
        public PerfTestCounterAttribute(string categoryName, string counterName, string instanceName)
        {
            CategoryName = categoryName;
            CounterName = counterName;
            InstanceName = instanceName;
            TestIterations = 2;
            Threads = 2;
        }

        /// <summary>
        /// The number of iterations per thread.
        /// </summary>
        /// <value>The number of test iterations.</value>
        public int TestIterations;

        /// <summary>
        /// The number of concurrent threads on which the test method will run.
        /// </summary>
        /// <value>The number of concurrent threads.</value>
        public int Threads;


        /// <summary>
        /// Gets or sets the name of the category of the performance counter.
        /// </summary>
        /// <value>The name of the category.</value>
        public string CategoryName { get; internal set; }

        /// <summary>
        /// Gets or sets the name of the performance counter.
        /// </summary>
        /// <value>The name of the counter.</value>
        public string CounterName { get; internal set; }

        /// <summary>
        /// Gets or sets the name of the instance of the performance counter.
        /// </summary>
        /// <value>The name of the instance.</value>
        public string InstanceName { get; internal set; }
    }
}